feat(ci): sync generated API client from volcano-hosting#22
Closed
swkeever wants to merge 1 commit into
Closed
Conversation
Add a client-sync workflow that regenerates internal/apiclient from volcano-hosting's public OpenAPI spec and opens a PR when it drifts. It checks volcano-hosting out read-only (Kong App read token) and runs that repo's `make volcano-cli-apiclient-generate`, reusing the shared oapi-codegen command so the client never drifts from the upstream contract. The PR is opened with this repo's own GITHUB_TOKEN, so no shared GitHub App write access is needed. Since GITHUB_TOKEN PRs don't trigger pull_request CI, the job builds and tests the regenerated client itself before opening the PR. Runs daily and on demand (workflow_dispatch).
| go test ./internal/apiclient/... | ||
|
|
||
| - name: Create or update PR | ||
| uses: peter-evans/create-pull-request@v7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Keep
internal/apiclientin sync with volcano-hosting's public OpenAPI contract automatically. A scheduledclient-syncworkflow regenerates the client and opens a PR here when the upstream spec drifts.How
Kong/volcano-hostingout read-only (Kong App read token) and runs itsmake volcano-cli-apiclient-generate, so the exactoapi-codegencommand lives once, upstream, shared with hosting'sopenapi-checkgate — the client can't drift from the contract.auto/openapi-clientPR with this repo's ownGITHUB_TOKEN. No write access to a shared GitHub App is required.GITHUB_TOKEN-opened PRs don't triggerpull_requestCI, so the job builds + tests the regenerated client itself; the PR body and a failing job surface the result.workflow_dispatch.Prerequisites
scripts/ci/gen-volcano-cli-apiclient.sh) and thevolcano-cli-apiclient-generatemake target this workflow calls. Merge it first.vars.KONG_GH_APP_ID+secrets.KONG_GH_APP_PRIVATE_KEYavailable, and the Kong App must have contents: read onvolcano-hosting. No write permissions anywhere.Notes
The checked-in client predates volcano-hosting's recent logs API work, so the first run opens a real catch-up PR. Verified locally: regenerating with the upstream generator produces a client that builds against the
internal/apiwrapper and passesgo test ./internal/apiclient/....